package com.sabm.controller;

import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.sabm.model.Account;

// @author Phu Ta
@Controller
public class MainController {
	@RequestMapping("/")
	public String printMainPage(ModelMap model) {
		Account account = (Account) SecurityContextHolder.getContext()
		.getAuthentication().getPrincipal();
		model.addAttribute("username", account.getUsername());
		return "index";
	}
}
